-
Couldn't load subscription status.
- Fork 1.1k
[FDC Metrics] Move the app detection into 4 counter labels #9318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nd the number of apps for each platform (web, android, ios, flutter) as separate parameters in the `trackGA4` call. I modified `src/init/features/dataconnect/index.ts` to include granular app counts (`num_web_apps`, `num_android_apps`, etc.) in the `trackGA4` call for the `dataconnect_init` event. I have verified the changes in both `src/init/features/dataconnect/sdk.ts` and `src/init/features/dataconnect/index.ts`. The new analytics parameters are correctly implemented.
Summary of ChangesHello @fredzqm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the analytics data collected during the Data Connect initialization process. It shifts the method of reporting app platform usage from a consolidated string within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the Google Analytics tracking for Data Connect initialization by replacing a single flow string with more granular counters for each application platform. The changes are implemented correctly in both src/init/features/dataconnect/index.ts and src/init/features/dataconnect/sdk.ts. My review focuses on improving maintainability by addressing code duplication and the use of hardcoded strings.
|
/gemini review |
flow label to 4 countersThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the analytics tracking for Data Connect initialization by replacing a complex flow string with individual counters for each application platform. This is a positive change that improves the clarity and parsability of the collected analytics data. The implementation is sound and correctly achieves the stated goal. I have included one suggestion to refactor the new initAppCounters function for improved readability and type safety.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors Firebase Data Connect analytics to use counter labels for app detection instead of flow strings, making metrics more parseable in Google Analytics. The change simplifies how app platform data is tracked by converting from flow-based strings to discrete counter fields.
Key changes:
- Replace flow-based app tracking with individual counter labels (num_web_apps, num_android_apps, etc.)
- Add proper duration tracking for analytics events
- Handle absent firebase-data-connect labels with "absent" default value
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/init/features/dataconnect/sdk.ts | Adds initAppCounters() function and refactors analytics tracking to use counters instead of flow strings |
| src/init/features/dataconnect/index.ts | Updates main dataconnect init to use new counter-based analytics and include duration |
| src/dataconnect/provisionCloudSql.ts | Sets default "absent" value for missing firebase-data-connect labels |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@rosalyntan Got another small metrics PR~ |
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively refactors the analytics for dataconnect_init by moving app platform detection into dedicated counters, which will improve the clarity and structure of the collected metrics. The changes are consistently applied throughout the codebase, including updates to interfaces, function calls, and tests. The switch to using void for trackGA4 calls is a good reliability improvement, preventing analytics issues from breaking command execution. The logic for calculating event duration and handling different initialization flows is also well-implemented. I have one suggestion to enhance the maintainability of the new initAppCounters function.
We were getting some hard to parse
flowin GA.Besides this, a few misc fixes:
dataconnect_initandcommand_execution.trackGA4. Their failures should cause command failure.firebase-data-connectlabel is absentDescription
Scenarios Tested
Sample Commands